﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WatiNCF.Automater.Business.Adapters;

namespace WatiNCF.Automater.Controls
{
    public partial class BaseDataEntryControl : UserControl
    {
        public InfoAdapter Adapter { get; set; }

        public BaseDataEntryControl()
        {
            InitializeComponent();
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (!DesignMode)
            {
                Initialise();
                SetName(Adapter.GetName());
                EnableControls();
            }
        }

        public virtual void Initialise()
        {
        }

        public virtual void SetName(string name)
        {
        }

        public virtual object GetValue()
        {
            return null;
        }

        public virtual void EnableControls()
        {
            // Do nothing by default
        }

        public virtual void SetFocus()
        {
            Focus();
        }
    }
}
